<%@page import="tyx.study.jsp.javabean.Emp"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html><html><head><meta charset="UTF-8">
<title>Insert title here</title>
<script type="text/javascript">
 function  firm() {
	if(confirm("确定要删除吗？")){
		return true;}
	else {return false;}}
</script></head>
<body><a href="<%=request.getContextPath() %>/addEmp">添加员工</a>
	<c:if test="${!(empty empList)}">
	<form action="${pageContext.request.contextPath }/allEmp">
		每页记录数：<input name="pageNum" type="text">
		<button>提交</button> 
	</form>
	<table border="1">
		<tr>
			<th>员工编号</th><th>员工姓名</th><th>员工职务</th><th>员工雇佣时间</th>
			<th>员工工资</th>
			<td>操作</td>
		</tr>
		<c:forEach items="${ empList}" var="e">
		
		<tr>
			<td>${e.eno}</td>
			<td>${e.ename}</td>
			<td>${e.ejob}</td>
			<td>${e.ehiredate}</td>
			<td>${e.esalary }</td>
			<td>
				<a href="${pageContext.request.contextPath}/findEmp?eno=${e.eno}">修改</a>
				<a href="${pageContext.request.contextPath}/removeEmp?eno=${e.eno}" 
				onclick="return firm()">删除</a>
			</td></tr> 
		</c:forEach>
	</table></c:if>
	<a href="${pageContext.request.contextPath }/allEmp?page=
	${page-1 <=0?1:page-1}&&pageNum=${pageNum}">上一页</a>
	<a href="${pageContext.request.contextPath }/allEmp?page=
	${page>= pages?pages:page+1}&&pageNum=${pageNum}">下一页</a>
</body>
</html>